#include<bits/stdc++.h>
using namespace std;
#define y1 yy

int n,x1,y1,x2,y2;
const int dx[] = {0,0,1,-1};
const int dy[] = {1,-1,0,0};

int fn[2][401][401];

int dfs(int ok,int pos1,int pos2,int m){
	if(pos1==pos2) return ok?m:INT_MAX;
	if(m>3*n+1){
		return INT_MAX;
	}
	if(fn[ok][pos1][pos2]<=3*n){
		return fn[ok][pos1][pos2];
	}
	if(fn[ok][pos1][pos2]!=-1) return fn[ok][pos1][pos2]=min(fn[ok][pos1][pos2],m);
	int wx=pos1/n+1,wy=pos1%n+1;
	int bx=pos2/n+1,by=pos2%n+1;
	int wxx,wyy,bxx,byy;
	int pos11, pos22;
	if(ok){
		for(int k=0;k<4;k++){
			wxx = wx+dx[k];
			wyy = wy+dy[k];
			if(wxx>n||wxx<1||wyy>n||wyy<1){
				continue;
			}
			pos11 = (wxx-1)*n+(wyy-1);
			pos22 = pos2;
			fn[ok][pos1][pos2]=min(dfs(!ok,pos11,pos22,m+1)-1,fn[ok][pos1][pos2]);
		}
	}
	else{
		for(int k=0;k<4;k++){
			for(int dk=1;dk<=2;dk++){
				bxx = bx+dx[k]*dk;
				byy = by+dy[k]*dk;
				if(bxx>n||bxx<1||byy>n||byy<1){
					continue;
				}
				pos11 = pos1;
				pos22 = (bxx-1)*n+(byy-1);
				fn[ok][pos1][pos2]=min(dfs(!ok,pos11,pos22,m+1)-1,fn[ok][pos1][pos2]);
			}
		}
	}
	return fn[ok][pos1][pos2];
}

int main(){
	scanf("%d%d%d%d%d",&n,&x1,&y1,&x2,&y2);
	// white win
	if(x1==x2&&abs(y1-y2)==1||y1==y2&&abs(x1-x2)==1){
		printf("WHITE 1\n");
		return 0;
	}
	memset(fn,0x3f,sizeof(fn));
	cout<<"BLACK "<<dfs(1, (x1-1)*n+(y1-1), (x2-1)*n+(y2-1), 0)<<endl;
	return 0;
}
